﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="AvailableTags.aspx.vb" Inherits="MyProject.WebForm8" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    Select Tag: <br /> <br /><asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" 
        DataSourceID="AccessDataSource1" DataTextField="Tag" DataValueField="Tag">
    </asp:DropDownList>
    <asp:AccessDataSource ID="AccessDataSource1" runat="server" 
        DataFile="~/App_Data/AssignmentDB.accdb" 
        SelectCommand="SELECT DISTINCT [Tag] FROM [Tag]"></asp:AccessDataSource>
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        CellPadding="4" DataSourceID="AccessDataSource2" ForeColor="#333333" 
        GridLines="None">
        <AlternatingRowStyle BackColor="White" />
        <Columns>
            <asp:BoundField DataField="ItemName" HeaderText="Title" 
                SortExpression="ItemName" />
            <asp:ImageField AccessibleHeaderText="Picture" DataImageUrlField="File">
                <ControlStyle CssClass=".image" Height="150px" Width="150px" />
                <ItemStyle CssClass=".image" Height="150px" Width="150px" />
            </asp:ImageField>
            <asp:HyperLinkField DataNavigateUrlFields="ID" 
                    DataNavigateUrlFormatString="photodetail.aspx?ID={0}" Text="Detail" />
        </Columns>
        <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
        <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
        <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
        <SortedAscendingCellStyle BackColor="#FDF5AC" />
        <SortedAscendingHeaderStyle BackColor="#4D0000" />
        <SortedDescendingCellStyle BackColor="#FCF6C0" />
        <SortedDescendingHeaderStyle BackColor="#820000" />
    </asp:GridView>
    <asp:AccessDataSource ID="AccessDataSource2" runat="server" 
        DataFile="~/App_Data/AssignmentDB.accdb" 
        SelectCommand="SELECT DISTINCT [ID], [ItemName], [File] FROM [Tag Query] WHERE ([Tag] = ?)">
        <SelectParameters>
            <asp:ControlParameter ControlID="DropDownList1" Name="Tag" 
                PropertyName="SelectedValue" Type="String" />
        </SelectParameters>
    </asp:AccessDataSource>
    <br />
    <br />
    <br />
    </asp:Content>
